﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;

namespace ScrumTracker.Models
{
    [MetadataType(typeof(UserMetadata))]
    public partial class User
    {
        public string FullName
        {
            get
            {
                return string.Format("{0} {1}", this.FirstName, this.LastName);
            }
        }
    }

    public class UserMetadata
    {
        [HiddenInput(DisplayValue = false)]
        public int UserId { get; set; }
        [Display(Order = 1)]
        [Required(AllowEmptyStrings = false)]
        public string FirstName { get; set; }
        [Display(Order = 2)]
        [Required(AllowEmptyStrings = false)]
        public string LastName { get; set; }
        [Required(AllowEmptyStrings = false)]
        public string Email { get; set; }
        [ScaffoldColumn(false)]
        public string FullName { get; set; }
        [ScaffoldColumn(false)]
        public string PasswordHash { get; set; }
        [ScaffoldColumn(false)]
        public DateTime CreatedAt { get; set; }
    }
}